<template>
	<view class="quan">
		<view class="core_list" v-for="(item,index) in fenlei" :key="index" @click="content(item.id)">
		<view class="top">
			<view class="title"> {{index+1}}.{{item.title}}</view>
			<view class="right"><image style="width: 30upx;height: 40upx;padding: 20upx 30upx 0upx 0upx;" src="../../static/right.png"></image></view>
		</view>
		<parser :html="data[index]" class="pice" style="width: '100%';" ></parser>
			</view>
	</view>
</template>

<script>
	import parser from "@/components/jyf-Parser/index"
	export default {
		components: {
		   parser
		 },
		data() {
			return {
				id:'',
				fenlei:[],
				data:[],
				url:this.$host,
				videourl:'',
				show:'',
			}
		},
		onLoad(option) {
			var id=option.id
			this.id=option.id
			console.log(this.id)
			uni.request({
					url: 'http://tuiguang.yiyunoto.com/api/index/articlelist',
					method:'POST',
					data:{typeid:this.id},
					headers:{authtoken:this.$store.state.token},
					success: (res) => {
					console.log("分类",res)
					this.fenlei=res.data.data
					for (let i = 0; i < res.data.data.length; i++) {
						this.desc= res.data.data[i].content.replace(/\<video /gi,'<video style="width:100%;" ')
							this.data.push(this.desc.replace(/\ src="/g,' src="'+this.url))
							
					}
					console.log("分类",this.fenlei)
					
					},
					fail:(res)=>{
						console.log("请求失败",res)
					}
				});
		},
		methods: {
			content(e){
				console.log("id",e)
				uni.navigateTo({
					url:"../content/content?id="+e
				})
			}
		}
	}
</script>

<style>
.quan{
	width:100%;
	height: 100vh;
	background:#f5f4f9;
}
.top{
	width: 100%;
	height: 80upx;
	border-bottom: #ededed solid 1upx;
}
.title{
	width:80%;
	line-height: 80upx;
	float: left;
	font-weight: bold;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.right{
	width: 10%;
	line-height: 80upx;
	float: right;
	/* box-sizing: border-box; */
}
.core_list{
		width: 100%;
		border-bottom: #333333 solid 1upx;
		box-sizing: border-box;
		/* margin: 10upx auto; */
		padding: 10upx;
		background: #FFFFFF;
	}
	.pice{
		width: 100%;
		padding: 50upx;
		box-sizing: border-box;
	}
	.myVideo{
		width:90%;
		height:200upx;
		padding-left:5%;
		/* margin: 10upx auto; */
	}
</style>
